/*
 * @Author: COCROODILE 3082897304@qq.com
 * @Date: 2024-11-29 17:06:21
 * @LastEditors: COCROODILE 3082897304@qq.com
 * @LastEditTime: 2024-11-29 17:27:35
 * @FilePath: \zk-clservice-order-qd\src\utils\request.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import axios from 'axios'

// import { Message } from 'element-ui'

axios.defaults.headers['Content-Type'] = 'application/ocset-stream'
// 创建axios实例
const service = axios.create({
  // axios中请求配置有baseURL选项，表示请求URL公共部分
  baseURL: 'https://88zkaq.com/cls/prod-api',
  // baseURL: 'http://192.168.0.142:8300',
  // 超时
  timeout: 10000,
  headers: {
    "Content-Type": "application/json;charset=utf-8",
    "Access-Control-Allow-Origin": "*",
  }
})

service.interceptors.request.use(config => {
let token = localStorage.getItem('token')
config.headers['Authorization'] = token
  // config['Content-Type']
  return config
}, error => {
  return Promise.reject(error)
})

export default service